﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AFT.Parking.Foundation.Caching
{
    /// <summary>
    /// 缓存接口
    /// </summary>
    public interface ICache
    {
        /// <summary>
        /// 根据缓存键获取缓存值
        /// </summary>
        /// <param name="key">缓存键值</param>
        /// <returns>缓存实例</returns>
        object Get(string key);

        /// <summary>
        /// 批量获取键值对
        /// </summary>
        /// <param name="keys"></param>
        /// <returns></returns>
        //IDictionary<string, object> Gets(IEnumerable<string> keys);

        /// <summary>
        /// 新增一个缓存
        /// </summary>
        /// <param name="key">缓存键</param>
        /// <param name="value">缓存值</param>
        /// <param name="timeout">过期时间（单位：毫秒）</param>
        /// <returns></returns>
        void Insert(string key, object value, int timeout);
      
        /// <summary>
        /// 清除单个缓存
        /// </summary>
        /// <param name="key">缓存键</param>
        /// <returns>被清除的缓存对象实例的缓存对象实例</returns>
        object Remove(string key);

        /// <summary>
        /// 删除所有缓存
        /// </summary>
        void RemoveAll();
    }
}
